package rcs34.android.AndroidRC.Receivers;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;

public class WifiStateReceiver extends BroadcastReceiver{
  public  static final int MSG_WIFI_STATE_CHANGED=101;
  public  static final int MSG_WIFI_NET_CHANGED=102;
  private Messenger messenger;
  private int listenTo;
  
  public WifiStateReceiver(Messenger _messenger, int _listenTo){
    messenger=_messenger;
    listenTo=_listenTo;
  }

  @Override
  public void onReceive(Context _context, Intent _intent) {
    Message message=new Message();
    message.arg1=listenTo;
    try {
      messenger.send(message);
    } catch (RemoteException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
  }
}
